<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div></div>
		<script type="text/javascript">
			/*
			   反引号 ``
			   1.插入变量和表达式
			   2.调用函数
			   3.换行和空格都会保留
			
			*/

			function fn() {
				return '男';
			}
			let name = '张三';
			let age = 20;
			console.log("my name is " + name + ",my age is" + age);
			console.log(`my name is ${name},my age is ${age}`);

			let table = "<table>" +
				"<tr>" +
				"<td>" + name + "</td>" +
				"</tr>" +
				"</table>";
			let table2 = `
			    <table>
				  <tr>
				    <td>${name}</td>
					<td>${age}</td>
					              <td>${fn()}</td>
			      </tr>
			    </table>
			`
			let div = document.querySelector('div');
			div.innerHTML = table2;
			console.log(table);
		</script>
	</body>
</html>
